package xyz.zhzby.cyzx.oj.convert;

import io.swagger.annotations.ApiModel;
import org.mapstruct.Mapper;
import org.mapstruct.NullValueCheckStrategy;
import org.mapstruct.NullValuePropertyMappingStrategy;
import org.mapstruct.factory.Mappers;
import xyz.zhzby.cyzx.oj.dto.request.ProblemAddRequest;
import xyz.zhzby.cyzx.oj.dto.response.ProblemResponse;
import xyz.zhzby.cyzx.oj.entity.Problem;

import java.util.List;

/**
 * @author zby
 * @date 2022/01/19
 */
@ApiModel("试题相关转换器")
@Mapper(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE, nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface ProblemConvert {

    ProblemConvert INSTANCE = Mappers.getMapper(ProblemConvert.class);

    Problem REQUEST_PROBLEM(ProblemAddRequest problemAddRequest);

    ProblemResponse PROBLEM_RESPONSE(Problem problem);

    List<ProblemResponse> PROBLEM_RESPONSE_LIST(List<Problem> problems);

}
